package com.tool4j.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serial;
import java.io.Serializable;

/**
 * @author Deng.Weiping
 * @since 2023/9/6 19:16
 */
@Data
@TableName("t_prompt_info")
public class Prompt implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    @JsonSerialize(using = ToStringSerializer.class)
    private Long sessionId;

    /**
     * 标题
     */
    private String title;

    /**
     * 描述
     */
    private String remark;

    /**
     * 分组
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long groupKey;

    /**
     * 提示词内容
     */
    @JsonIgnore
    private String content;

    /**
     * 参数
     */
    @JsonIgnore
    private String params;

    /**
     * 参数对象
     */
    @TableField(exist = false)
    private Params paramsObj;

    /**
     * 评分
     */
    private Float score;

    /**
     * 使用次数
     */
    private Integer usedTotal;

    @Data
    @Accessors(chain = true)
    public static class Params {

        /**
         * 参数中文名称
         */
        private String name;

        /**
         * 参数键
         */
        private String key;

        /**
         * 参数值
         */
        private String value;
    }
}
